#pragma once

#include "Point.h"
#include "Vector2D.h"
#include <vector>
#include "SDL.h"
#include "SDL_image.h"
#include "SDL_mixer.h"

class InputHangdler
{
public:

	virtual ~InputHangdler();

	static InputHangdler* Instance()
	{
		if (m_pInstance == 0)
		{
			m_pInstance = new InputHangdler();
		}

		return m_pInstance;
	}

	Point getMousePossition();
	Point getMousePossitionMove();

	void isKeyDown();
	void update();

	// reset click mouse down

	void resetMouseDown(int &);
	bool getResetMouseDown();
	/////////////////////////
	// 
	SDL_Keycode getKeyCode();
	bool InputHangdler::isKeyDown(SDL_Keycode key)
	{
		/*if(m_keystates != 0)
		{
		if(m_keystates[key] == 1)
		{
		return true;
		}
		else
		{
		return false;
		}
		}*/
		return false;
	}

protected:
private:

	InputHangdler();
	
	SDL_Keycode m_keyCode;

	Point m_mousePossition;
	Point m_mousePossitionMove;

	// method private
	void onKeyDown(SDL_Event &event);
	void onKeyUp();

	// hangdle mouse event
	void onMouseMove(SDL_Event &event);
	void onMouseButtonDown(SDL_Event &event);
	void onMouseButtonUp(SDL_Event &event);

	//// 
	static InputHangdler* m_pInstance;

	// reset
	bool m_bButtonDown;

};

typedef InputHangdler TheInputHangdler;